// 封装专门用来发跟频道相关的请求
import instance from '../utils/request'

export const getChannels = ()=>{
    return instance({
        url:'/v1_0/user/channels',
        method:'GET'
    })
}

// 获取所有频道
export const getAllChannels = ()=>{
    return instance({
        url:'/v1_0/channels',
        method:'GET'
    })
}

// 封装一个添加频道的接口
export const addChannnel = (channels)=>{
    return instance({
        url:'/v1_0/user/channels',
        method:'PATCH',
        data:{
            channels
        }
    })
}

// 封装一个删除频道的接口
export const removeChannel = (channels)=>{
    return instance({
        url:'/v1_0/user/channels',
        method:'DELETE',
        data:{
            channels
        }
    })
}